package com.zyj.test.month1.day14;

/**
 * @author Yijia Zhang
 * @create 2024-06-01 00:48
 */
public class code0027 {
    public int removeElement(int[] nums, int val) {
        int len = nums.length;
        int idx = 0;
        for (int i = 0; i < nums.length; i++) {
            if (val != nums[i]) {
                nums[idx++] = nums[i];
            }
        }
        return idx;
    }
}
